<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
       class Dog{
        constructor(name,age){
            this.age = age
            this.name = name
        }
        eat(){
            console.log(this.name)
        }
        static abc= 123
       static def(){
        console.log('234')
       }
       }
      
       const dog = new Dog('来福')
       //静态属性和方法，仅能由类名来调用
       console.log(Dog.abc)
       Dog.def()
     
    </script>
</body>
</html>